home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 7602 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Can Windows DLL identify caller?
  5. Date: 25 Feb 1996 16:48:01 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4gr001INNi52@keats.ugrad.cs.ubc.ca>
  8. References: <NEWTNews.825272087.8651.jbarrett@westridg.demon.co.uk>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <NEWTNews.825272087.8651.jbarrett@westridg.demon.co.uk>,
  12. Jon A Barrett  <jbarrett@westridg.demon.co.uk> wrote:
  13.  >
  14.  >I've written a DLL in C that supplies 'secure' information to registered
  15.  >programs. I have a relatively safe mechanism to ensure that the registered
  16.  >programs have not been tampered with (checksums, image headers etc) but how
  17.  >can I tell whose calling.
  18.  >
  19.  >Is there anyway that a DLL can identify something about the caller? Obviously
  20.  >it will have to be something implicit, caller supplied parameters would be
  21.  >open to abuse.
  22.  
  23. Does your OS have user id's? Or at least process id's? These kinds of things
  24. should be available via a system call to any library function, so that it can
  25. readily identify the security context under which it is executing.
  26.  
  27. In a UNIX shared library, I you can call getpid() to get the process id,
  28. getuid() and geteuid() to get the real and effective user id, and so forth.  
  29. -- 
  30.  
  31.